<?php
    class News_model extends CI_Model {

        public function __construct ()
        {
            parent::__construct();
            $this->load->database();
        }
        public function get_news($id)
        {
        // if ($slug === FALSE)
        // {
            $this->db->where('id',$id);
            // $this->db->select('*');
            $query = $this->db->get('news');
            return $query->result_array();
        // }
    
        // $query = $this->db->get_where('news', array('slug' => $slug));
        // return $query->row_array();
        }
        //还没学会groupby用法！！！
        public function groupBy_news($col)
        {
            $this->db->group_by($col);
            $query = $this->db->get('news');
            return $query->result_array();
        }
    }
?>